import { defineConfig } from "vite";
import { resolve } from "path";

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    // 当使用文件系统路径的别名时，请始终使用绝对路径。相对路径的别名值会原封不动地被使用，因此无法被正常解析。
    alias: {
      "@/": "./src/",
    },
  },
  build: {
    outDir: "package/voicecontrol-sdk/dist",
    lib: {
      // Could also be a dictionary or array of multiple entry points
      entry: resolve(__dirname, "./src/lib/index.ts"),
      name: "voicecontrol-sdk",
      // the proper extensions will be added
      fileName: "voicecontrol-sdk",
    },
  },
});
